const {
  request
} = require('./http')
module.exports = {
  // 首页面接口
  gethomedata: () => request('/home/index', ), //首页商品数据
  getgoodscount: () => request('/goods/count', ), //商品总数量
  
  //  分类接口
  getcatalogindex: () => request('/catalog/index'), //分类页全部数据
  getcatalogcurrent: (id) => request('/catalog/current?id=' + id), //分类页当前分类数据

  //登录相关接口
  authloginwx: (method, data) => request('/auth/login_by_weixin', data, method),//微信登录
  authlogin: (data) => request('/auth/login',data,'POST'),//账号登录
  authregister:(data)=>request('/auth/register',data,'POST'),//账号注册
  // 详情页相关接口
  getgoodsdetail:(id)=>request('/goods/detail?id='+id),//商品详情 
  getgoodsrelated:(id)=>request('/goods/related?id='+id),//相关商品
  // 商品相关接口
  getgoodsnumber:()=>request("/cart/goodscount"),//购物车商品数量
  addcart:(data)=>request("/cart/add",data,'POST'),//添加到购物车
  getcartdata:()=>request("/cart/index"),//获取购物车数据
  changecartchecked:(data)=>request("/cart/checked",data,'POST'),//选择或取消选择商品
  deletcart:(data)=>request("/cart/delete",data,'POST'),//删除购物车数据
}